//
//  JKRFeedProgressView.m
//  JKRFeedDemo
//
//  Created by Lucky on 2017/12/10.
//  Copyright © 2017年 Lucky. All rights reserved.
//

#import "JKRFeedProgressView.h"

@interface JKRFeedProgressView ()

@end

@implementation JKRFeedProgressView

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    self.backgroundColor = [UIColor colorWithRed:244/255.0 green:247/255.0 blue:248/255.0 alpha:1.0];    
    return self;
}

- (void)setLayout:(JKRFeedProgressLayout *)layout {
    _layout = layout;
    self.hidden = !layout.show;
    if (!layout.show) {
        return;
    }
    self.frame = layout.progressFrame;
    [self removeAllSubviews];
    for (UIView *view in layout.subViews) {
        [self addSubview:view];
    }
}

@end
